<div class="modal fade zanpian-modal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true" style="display:none;">
  <div class="modal-dialog clearfix">
    <div class="modal-content clearfix">
    <div class="modal-header">
      <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
          <div class="zanpian-modal-tabs">
          <ul id="myTab">
          <li class="active"><a href="#pay_online" data-toggle="tab">在线充值</a><li>
          <li><a href="#pay_card" data-toggle="tab">卡密充值</a></li>
          </ul>
         </div>
    </div>
    <div class="modal-body">
   <div class="modal-body-tab text-center active in" id="pay_online">
   <form class="form-horizontal forum-payment" action="{:zanpian_user_url('user/payment/index')}" method="post" role="form" target="_blank" style="padding:20px 0" data-small="">
        <div class="form-group">
           <label for="score_ext" class="col-sm-3 control-label">充值金额</label>
           <div class="col-sm-6">
            <input class="form-control text-center" name="score" id="score" value="{$Think.config.user['pay']['pay_small']}" type="text" required>
          </div>
        </div>
       <div class="form-group">
          <label for="pay_type" class="col-sm-3 control-label">支付方式</label>
           <div class="col-xs-12 col-sm-6">
                <select name="payment" id="payment" class="form-control">
                   {volist name="pay_list" id="zanpian"}
                        <option value="{$zanpian}"> 
             {switch name="zanpian"}
            {case value="alipay"}支付宝{/case}
            {case value="weixinpay"}微信{/case}
            {case value="atfpay"}艾特付{/case}
            {case value="codepay"}码支付{/case}            
            {case value="paypal"}PayPal{/case}
            {/switch}</option>
            {/volist}
                    </select>
                </div>
        </div>
            
        <div class="form-group" id="paytypelist" style="display:none;">
          <label for="pay_type" class="col-sm-3 control-label">支付类型</label>
           <div class="col-xs-12 col-sm-6">
				<select class="form-control paytype" id="paytype" name="paytype">
				</select>
                </div>
        </div>       
        <button type="submit" class="btn btn-success" id="user-pay">提交</button>
      </form>
    </div>
    
   <div class="modal-body-tab text-center fade" id="pay_card">
   <form class="form-horizontal form-pay-card"  method="post" role="form" style="padding:20px 0" method="post" onsubmit="return false;">
        <div class="form-group">
           <label for="score_ext" class="col-sm-3 control-label">充值卡号</label>
           <div class="col-sm-6">
            <input class="form-control text-center" name="card_number" id="card_number" value="" type="text" required>
          </div>
        </div>
         <a class="btn btn-primary" href="{$Think.config.user['pay']['pay_card_url']}" target="_blank">购买卡密</a>
        <button type="submit" class="btn btn-success" id="user-pay-card">提交充值</button>
      </form>
    </div>
    </div>
   <div class="modal-footer">
    <h6 class="text-center">1元等于<span class="text-color">{$Think.config.user['pay']['pay_scale']}</span>个积分，最低<span class="text-color">{$Think.config.user['pay']['pay_small']}</span>元起充，支持微信、支付宝、网银等在线充值</h6>
    </div>
</div>
<script>
	var codepay_type = '{volist name="codepay_type" id="zanpian"}<option value ="{$zanpian}">{switch name="zanpian"}{case value="1"}支付宝二维码{/case}{case value="2"}QQ钱包{/case}{case value="3"}微信二维码{/case}{/switch}</option>{/volist}';
	 if ($("select[name='payment'] option:selected").val() == 'codepay') {
		   $('#paytype').html(codepay_type);
		   $("#paytypelist").show();
	 }else{
		   $("#paytypelist").hide();
	 }
	$("#payment").change(function() {
		$('#paytype').html('');
		if($("#payment").val()=="codepay"){
			if($("#payment").val()=="codepay") {
				$('#paytype').html(codepay_type);
			}
			$("#paytypelist").show();
		}
		else{
			$("#paytypelist").hide();
		}
	});
	$("#paytype").change(function() {
		$('#paytype').val( $(this).val() );
	});
</script>